Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resets failed login count on password reset from any source #1387

Merged
merged 3 commits into from
Aug 23, 2023

Conversation

henxing
Copy link
Contributor

@henxing henxing commented Aug 22, 2023

No description provided.

Comment on lines +440 to +449
password_modified = instance.password != original_instance.password
is_monitored = password_modified or any(
getattr(instance, fieldname, None) != getattr(original_instance, fieldname, None)
for fieldname in monitored_fields
)

if is_monitored:
if password_modified:
instance.failed_login_count = 0
block_user_save_email(instance, "save")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the part that does the reset, for anyone reviewing.

@henxing henxing merged commit dfce7ed into main Aug 23, 2023
4 checks passed
@henxing henxing deleted the bug/reset_last_login branch August 23, 2023 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant